<?php

namespace app\home\controller\business;

use app\common\controller\Home;

/**
 * 联系我们控制器
 */
class Contact extends Home
{
    //不需要登录的方法
    protected $noNeedLogin = ['index'];

    //构造函数
    public function __construct()
    {
        parent::__construct();
    }

    // 联系我们
    public function index()
    {
        $SubjectModel = model('Subject.Subject');
        //查询点赞量最多降序8个 字符串 数值排序
        $toplist = $SubjectModel->orderRaw("LPAD(LOWER(likes), 10,0) DESC")->limit(8)->select();
        //赋值
        $this->view->assign([
            'toplist' => $toplist,
        ]);
        return $this->view->fetch();
    }
}
